package com.oj.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Classname Result
 * @Description TODO
 * @Date 2025/3/16 20:40
 * @Created by xxx
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    public static final int SUCCESS = 0;
    public static final int ERROR = 1;

    private int code;
    private String message;
    private Object data;

    public static Result success(String message, Object data) {
        return new Result(SUCCESS, message, data);
    }

    public static Result fail(String message, Object data) {
        return new Result(ERROR, message, data);
    }
}
